﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SzCourt.Logic.BLL;
using SzCourt.Logic.NBL.DBEntities;

namespace SzCourt.WebSite.served
{
    public partial class list : System.Web.UI.Page
    {
        private string _CaseName = string.Empty;
        private string _CaseWord = string.Empty;
        private string _Password = string.Empty;
        private string _Zhi = string.Empty;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                getList();
            }
        }

        private void getList()
        {
            //获取参数

            this._Password = string.IsNullOrEmpty(Request.Form["txtPassword"]) ? "" : Request.Form["txtPassword"];
            this._CaseWord = string.IsNullOrEmpty(Request.Form["txtCaseWord"]) ? "" : Request.Form["txtCaseWord"];
            this._CaseName = string.IsNullOrEmpty(Request.Form["txtClassName"]) ? "" : Request.Form["txtClassName"];
            this._Zhi = string.IsNullOrEmpty(Request.Form["txtZhi"]) ? "" : Request.Form["txtZhi"];

            //调用方法
            CaseCondition param = new CaseCondition();

            param.CaseName = "(" + this._CaseName + ")" + this._Zhi + "字第" + this._CaseWord + "号";
            param.QueryPWD = this._Password;

            Case bll = new Case();
            pCaseProgressInfo result = (pCaseProgressInfo)bll.GetCaseInfo(param);

            if (result != null)
            {
                List<pCaseProgressInfo> listCPI = new List<pCaseProgressInfo>();
                listCPI.Add(result);
                this.rptDataList.DataSource = listCPI;
                this.rptDataList.DataBind();

                if (listCPI.Count == 0)
                {
                    this.noData.Attributes.Add("class", "mgn10 g_tc");
                }
            }
            else
            {
                this.noData.Attributes.Add("class", "mgn10 g_tc");
            }
        }
    }
}